# -*- coding: utf-8 -*-
# @author: wch
# @file: numpy_learn.py
# @time: 2023/2/3 17:32

import numpy as np

# 创建矩阵
# 检索与赋值[y,x]
# 获取子数组[:,:]

# 创建数组 array()
# 创建全0数组 zeros()/ones()
# 创建全值数组 full()
# 创建单元数组identity/eye()

# 通过array定义矩阵
a = np.array([2, 3, 4])
c = np.array([[1.0, 2.0], [3.0, 4.0]])

print(a)
print(c)

# zeros((行数，列数，通道数）,dtype)

c = np.zeros((3, 4, 3), np.uint8)

# ones((行数，列数，通道数）,dtype)

d = np.ones((8, 8), np.uint8)
print(d)

#  full((行数，列数，通道数）,number,dtype)
e =np.full((8,8),255,np.uint8)
print(e)


# identity() 单位矩阵
f = np.identity(4)
print(f)

# eye(）     长方形矩阵
g = np.eye(5,7,k=3)
print(g)